// Copyright (C) Kumo inc. and its affiliates.
// Author: Jeff.li lijippy@163.com
// All rights reserved.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published
// by the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <https://www.gnu.org/licenses/>.
//


#pragma once

#include <stdint.h>
#include <cstddef>
#include <string>

namespace Azure::Storage::Files::DataLake::Models {
class PathProperties;
}

namespace kumo::pollux::filesystems {

// Azurite Simulator does not yet support the DFS endpoint.
// (For more information, see https://github.com/Azure/Azurite/issues/553 and
// https://github.com/Azure/Azurite/issues/409).
// You can find a comparison between DFS and Blob endpoints here:
// https://github.com/Azure/Azurite/wiki/ADLS-Gen2-Implementation-Guidance
// To facilitate unit testing of file write scenarios, we define the
// AzureDatalakeFileClient which can be mocked during testing.

class AzureDataLakeFileClient {
 public:
  virtual ~AzureDataLakeFileClient() {}

  virtual void create() = 0;
  virtual Azure::Storage::Files::DataLake::Models::PathProperties
  getProperties() = 0;
  virtual void append(const uint8_t* buffer, size_t size, uint64_t offset) = 0;
  virtual void flush(uint64_t position) = 0;
  virtual void close() = 0;
  virtual std::string getUrl() const = 0;
};
} // namespace kumo::pollux::filesystems
